ποΈGitΠ―ΡΠ°ποΈ
docs/en/developer/architecture.md f17c38bf64dcd629641d1e310876871a2f8bfdac (f17c38bf) Text, 4.94 KB
title: Architecture
parent: Developer Guide
nav_order: 1
last_updated: 2026-05-13
aliases:
β’ layers
β’ module-architecture
β’ kmp
Architecture
The Meshtastic Android/Desktop/iOS application follows a modular Kotlin Multiplatform (KMP) architecture with clear layer boundaries.
Layer Overview
T282828
βββββββββββββββββββββββββββββββββββββββββββββββ
β androidApp / desktopApp β Platform entry points
βββββββββββββββββββββββββββββββββββββββββββββββ€
β feature/* modules β UI + Business Logic
βββββββββββββββββββββββββββββββββββββββββββββββ€
β core/* modules β Shared infrastructure
βββββββββββββββββββββββββββββββββββββββββββββββ€
β Platform (Android/JVM/iOS) β OS-specific bindings
βββββββββββββββββββββββββββββββββββββββββββββββ
Module Categories
T383838androidApp/ β Android Application
The Android application entry point:
β’ Activity, Application, and Manifest definitions
β’ Koin DI module composition (T383838AppKoinModule)
β’ Flavor-specific bindings (T383838google/, T383838fdroid/)
β’ Android-only integrations (widgets, services)
T383838desktopApp/ β Desktop JVM Application
The Desktop (Linux/macOS/Windows) entry point:
β’ Compose Desktop window management
β’ Desktop-specific DI (T383838DesktopKoinModule)
β’ Platform stubs for Android-only capabilities
β’ BLE (Kable), Serial, and TCP transport implementations
T383838feature/* β Feature Modules
Each T383838feature/ module owns a vertical slice of functionality:
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββ
β Module β Responsibility β
ββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββ€
β T383838feature:intro β Onboarding/welcome flow β
β T383838feature:messaging β Messages, channels, contacts, quick chat β
β T383838feature:connections β Bluetooth/USB/TCP connection management β
β T383838feature:map β Map display, waypoints β
β T383838feature:node β Node list, node detail, metrics β
β T383838feature:settings β All configuration screens β
β T383838feature:firmware β Firmware update flow β
β T383838feature:docs β In-app documentation browser β
β T383838feature:wifi-provision β WiFi provisioning β
β T383838feature:widget β Android home screen widgets β
ββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββ
Feature modules:
β’ Use the T383838meshtastic.kmp.feature convention plugin
β’ Depend on T383838core modules, never on other T383838feature modules
β’ Own their navigation entries and DI registrations
β’ Contain platform-specific implementations in T383838androidMain/T383838jvmMain/T383838iosMain
T383838core/* β Core Modules
Shared infrastructure used by all features:
βββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββ
β Module β Responsibility β
βββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββ€
β T383838core:common β Utilities, extensions, build config β
β T383838core:navigation β Routes, deep links, Navigation 3 β
β T383838core:ui β Shared Compose components, icons, theme β
β T383838core:resources β Shared string resources β
β T383838core:model β Domain models β
β T383838core:data β Data layer abstractions β
β T383838core:database β Room KMP database β
β T383838core:datastore β DataStore preferences β
β T383838core:prefs β App preferences β
β T383838core:repository β Repository interfaces β
β T383838core:service β Mesh service layer β
β T383838core:di β DI utilities β
β T383838core:network β HTTP/serial/transport β
β T383838core:ble β Bluetooth LE abstractions β
β T383838core:proto β Protobuf definitions β
β T383838core:testing β Test utilities β
βββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββ
KMP Source Sets
Each module uses the standard KMP source set hierarchy:
T282828
src/
βββ commonMain/ β Shared code (all platforms)
βββ commonTest/ β Shared tests
βββ androidMain/ β Android-specific
βββ jvmMain/ β Desktop JVM-specific
βββ iosMain/ β iOS-specific
βββ jvmTest/ β Desktop test host
Golden Rules:
β’ No T383838android.* imports in T383838commonMain
β’ Platform-specific code goes in appropriate source set
β’ Prefer interfaces + DI over T383838expect/T383838actual for complex behaviors
β’ Use T383838expect/T383838actual only for simple declarations
Dependency Injection
The project uses Koin with annotation processing:
β’ T383838@Module, T383838@Single, T383838@Factory annotations
β’ T383838@ComponentScan for automatic registration
β’ Feature modules export their own T383838Feature*Module class
β’ App/Desktop compose all modules in their root DI configuration
Navigation
Navigation uses Navigation 3 with typed routes:
β’ All routes defined in T383838core/navigation/Routes.kt
β’ Routes are T383838@Serializable data classes/objects
β’ Deep links resolved through T383838DeepLinkRouter
β’ Each feature registers its own navigation entries
See Navigation & Deep Links for details.
Served by rngit 1.5.0 - Generated in 0.04s